package com.opennews.openplatform

import groovy.transform.CompileStatic

@CompileStatic
class MapLocationController extends BaseController {
    AMapHelper amapHelper

    // region: Get actions.
    def index() {
        render("AMapController")
    }

    def queryByCoordinate() {
        def latitude = params.double("latitude")
        def longitude = params.double("longitude")
        def result = amapHelper.queryByCoordinate(latitude, longitude)

        sendDataResponse(result)
    }

    def queryPoiByKeywords() {
        def result = amapHelper.queryPoiByKeywords(params.keywords.toString())

        sendDataResponse(result)
    }
    // endregion
}
